<template>
<div class="announcement-management views-container">
  <div class="wlm-table">
    <div class="wlm-table-hearder-btn">
      <router-link tag="span" to="/setting/payManagementAdd">
        <el-button size="small" type="primary">添加支付方式</el-button>
      </router-link>
    </div>
    <div class="wlm-table-content">
      <el-table :ref="tableFormatData.announcement.key" :data="tableFormatData.announcement.tableData" @selection-change="handleSelectionChange" style="width: 100%">
        <!-- <el-table-column type="selection" width="55">
        </el-table-column> -->
        <el-table-column prop="date" label="支付名称" >
          <template slot-scope="scope">
            <span>{{scope.row.name}}</span>
          </template>
        </el-table-column>
        <el-table-column prop="date" label="支付类型" >
          <template slot-scope="scope">
            <span>{{payType[scope.row.type]}}</span>
          </template>
        </el-table-column>
        <el-table-column prop="name" label="状态" >
          <template slot-scope="scope">
            <span class="orders-green" v-if="scope.row.status==1">使用中</span>
            <span class="orders-gray" v-if="scope.row.status!=1">未使用</span>
          </template>
        </el-table-column>
        <el-table-column prop="address" label="操作" >
          <template slot-scope="scope">
             <div class="operation-group">
                <router-link class="wlm-text" tag="span" :to="{path:'/setting/payManagementAdd', query:{id:scope.row.id}}">
                  <el-button type="text">编辑</el-button>
                </router-link>
                <div class="btn-line"></div>
                <el-button class="wlm-text" type="text" @click="delTableItem(scope.row.id)">删除</el-button>
            </div>
          </template>
        </el-table-column>
      </el-table>
      <!-- <div class="pagination-content flex-row flex-justify-b flex-align-c">
        <el-row class="pagination-btns">
          <el-checkbox class="check-all"  true-label="1" false-label="0" v-model="tableFormatData.announcement.files.checkall" @change="toggleSelection">全部</el-checkbox>
          <el-button class="right-8" :disabled="isGroup" size="mini" @click="delTableList">删除</el-button>
        </el-row>
        <el-pagination :disabled="!hasTableData" @size-change="listPageChange" @current-change="listPageChange" :current-page.sync="tableFormatData.announcement.pagination.page" :page-sizes="tableFormatData.announcement.pagination.pagesizes" :page-size.sync="tableFormatData.announcement.pagination.list_rows" layout="total, sizes, prev, pager, next, jumper" :total="hasTableData?tableFormatData.announcement.pagination.total : 0">
        </el-pagination>
      </div> -->
    </div>
  </div>
</div>
</template>

<script>
import {
  paymentIndex,
  paymentDel
} from '@/api/setting'
import mixins from '@/mixins/mixins'
export default {
  mixins: [mixins.getters('Table')],
  name: 'ManagementPlatform',
  components: {

  },
  data() {
    return {
      payType: {
        '1': '微信支付',
        '2': '支付宝支付',
        '3': '百度支付',
        '4': '头条支付',
        '-': '-'
      },
      tableFormatData: {
        current: 'announcement',
        announcement: {
          key: 'announcement',
          api: {
            getList: paymentIndex,
            delList: paymentDel
          },
          tableData: [],
          files: {
            ids: [],
            checkall: '0'
          },
          noPages: true,
          pagination: {
            page: 1,
            list_rows: 10,
            pagesizes: [10, 20, 50],
            total: 0
          }
        }
      }
    }
  },
  methods: {

  }
}
</script>
